]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
NetworkMenu: use the carrier state to the decide if wired should be shown
authorGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 28 Jan 2014 22:41:13 +0000 (23:41 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 4 Feb 2014 21:25:11 +0000 (22:25 +0100)
The design says "when a network cable is connected", not
"When a network cable is connected and the link is up and we
have an IP etc. etc." (which is what ACTIVATED would imply).

https://bugzilla.gnome.org/show_bug.cgi?id=723570

js/ui/status/network.js

index 5c43ed3b5857721a5873f6544e220c797e20dd77..1d6d7c5646720a89a4eb39feb1457e00a50ddd2e 100644 (file)
@@ -432,16 +432,15 @@ const NMDeviceWired = new Lang.Class({
         this.item.menu.addMenuItem(createSettingsAction(_("Wired Settings"), device));
     },
 
-    _isConnected: function() {
-        if (!this._device.active_connection)
-            return false;
-
-        let state = this._device.active_connection.state;
-        return state >= NetworkManager.ActiveConnectionState.ACTIVATING;
+    _hasCarrier: function() {
+        if (this._device instanceof NMClient.DeviceEthernet)
+            return this._device.carrier;
+        else
+            return true;
     },
 
     _sync: function() {
-        this.item.actor.visible = this._isConnected();
+        this.item.actor.visible = this._hasCarrier();
         this.parent();
     },